<?php
header('Content-type: image/jpeg');
 
$image = new Imagick('../img/template.jpg');


$tu = new Imagick('../upic/oHJpP5Wo9wYTBPV9Q4nCBTqWHdq8-2.png');
$tu->resizeImage(610, 610,Imagick::FILTER_LANCZOS,1);

$image->compositeImage($tu, Imagick::COMPOSITE_DEFAULT, 75, 290);

$image->writeImage("../upic/1.jpg");

/**

$draw = new ImagickDraw();
 

$image->drawimage($draw);
file_put_contents('./pic/'.$uid.'.jpg', $image);

echo  json_encode(array('status'=>'ok'));

*/
?>